<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<!DOCTYPE html>
<html>
<head>
    <title>商家信息</title>
    <jsp:include page="../../include/header.jsp"></jsp:include>
  
</head>
<body >

<div id="wrapper">

		<div class="col-lg-12" style="height: 10%;text-align: center;">			
				<h1 class="page-header" style="margin-left:-20px; " ><c:if test="${object.state==3 || object.state==5}">
				<span class=" col-sm-3" style="padding-left:0px; ">商家入驻信息驳回或降权:</span>
				<a href="javascript:BoHui('{item.storeid}');"class=" col-sm-0 pull-left" style="padding-left:0px; " ><span class="btn" style="text-decoration:underline;color:red;">驳回原因</span></a>
				</c:if>商家信息
					<c:if test="${object.state==2 }"><button class="btn btn-success "  style=" margin-left: 100px;"onclick="edit();">编辑</button></c:if>
				</h1>		
				
		</div>
		<form id="" action="${BASE_PATH}/dict/seller/doEdit" method="post" class="form-horizontal" enctype="multipart/form-data">
			<div class="form-group">
			    <label class="col-sm-3 control-label">商家ID</label>
			    <div class="col-sm-6">
		        	<input type="text" name="sellerid" value="${object.sellerId}" class="form-control" placeholder="" required maxlength="20" readonly>
			    </div>
			</div>
			<div class="form-group">
			    <label class="col-sm-3 control-label">商家名称</label>
			    <div class="col-sm-6">
		        	<input type="text" name="sellerName" value="${object.sellerName}" class="form-control" placeholder="工商注册营业执照登记的全称" required maxlength="20" >
			    </div>
			</div>
			<div class="form-group">
			    <label class="col-sm-3 control-label">商家简称</label>
			    <div class="col-sm-6">
		        	<input type="text" name="shortName" value="${object.shortName}" class="form-control" placeholder="请输入您的商家简称" required maxlength="20" >
			    </div>
			</div>
			<div class="form-group">
			    <label class="col-sm-3 control-label">法人</label>
			    <div class="col-sm-6">
		        	<input type="text" name="legalPerson" value="${object.legalPerson}" class="form-control" placeholder="法人姓名" required maxlength="20">
		        	 <div class="col-sm-9"><span style="margin-right:10px; color:red;">***</span><span class="text-success">联系人手机号默认为H5前端登录账号，默认密码为手机号后6位</span></div>
			    </div>
			   
			</div>
			<div class="form-group">
			    <label class="col-sm-3 control-label">联系手机号</label>
			    <div class="col-sm-6">
		        	<input type="tel" id="contact" name="contact" value="${object.contact}" class="form-control" placeholder="请输入法人联系方式或企业实际控制人联系方式" required maxlength="11" readonly = "readonly" >
		        	
			    </div>
			    
			</div>
			<div class="form-group">
			    <label class="col-sm-3 control-label">营业执照号</label>
			    <div class="col-sm-6">
		        	<input type="text" id="" name="busLicense" value="${object.busLicense}" class="form-control" placeholder="营业执照注册号/社会统一信用代码" required maxlength="50" >
			    </div>
			</div>
			<div class="form-group">
			    <label class="col-sm-3 control-label">成立时间</label>
			    <div class="col-sm-6">
		        	<input type="text" name="settime" value="${object.settime}" class="form-control" placeholder="请输入成立时间(注意格式：20141212)" required maxlength="20">
			    </div>
			</div>
			<div style="width: 60%;margin: auto;">
			  <div style="width:30%;float: left; margin-left: 10%;">
				     <c:if test="${object.state==1 }">
				 	 <img src="${FTP_PATH}${object.busthumb}" alt="" style="width: 80%;"/>
				 	 </c:if>
				 	   <c:if test="${object.state==2 }">
				 	 <img src="${FTP_PATH}${object.busthumb}" alt="" style="width: 80%;"/>
				 	 </c:if>
				    <c:if test="${object.state==3 || object.state==4 || object.state==5|| object.state==6}">
				 	  <input type="file" id="thumb" name="busthumb" accept="image/jpg,image/png" title="选择文件" <c:if test="${object.busthumb!=null}">data-val="${object.busthumb}"</c:if>>
				   </c:if>
				   <footer style="text-align: center;">营业执照副本照片</footer> 
			  </div>
			  <div style="width:30%;float: right;margin-right: 10%;">
				    <c:if test="${object.state==1 }">
				  		<img src="${FTP_PATH}${object.perthumb}" alt="" style="width: 80%;"/>
				  	</c:if>
				    <c:if test="${object.state==2 }">
				  		<img src="${FTP_PATH}${object.perthumb}" alt="" style="width: 80%;"/>
				  	</c:if>
				  	<c:if test="${object.state==3 || object.state==4 || object.state==5|| object.state==6}">
				  		 <input type="file" id="thum" name="perthumb" accept="image/jpg,image/png" title="选择文件" <c:if test="${object.perthumb!=null}">data-val="${object.perthumb}"</c:if>>
				    </c:if>
				  <footer style="text-align: center;">法人身份证照片</footer>
			  </div>
			</div>
			
			<div class="row" style="margin-top: 80px; margin-bottom: 20px;">
				
				<div class="col-lg-8">
				<c:if test="${object.state==1 }">
					<button class="btn btn-primary col-sm-5 pull-right" style="width: 60%;height: 10%;text-align: center;"type="button" disabled="disabled" >入驻审核中</button>
				</c:if>
				<c:if test="${object.state==2 }">
					<button class="btn btn-primary col-sm-5 pull-right" style="width: 60%;height: 10%;text-align: center;" type="button" disabled="disabled" >已入驻</button>
				</c:if>
				<c:if test="${object.state==3  }">
					<button class="btn btn-primary col-sm-5 pull-right" style="width: 60%;height: 10%;text-align: center;"type="submit">重新提交</button>
				</c:if>
				<c:if test="${object.state==4 }">
					<button class="btn btn-primary col-sm-5 pull-right" style="width: 60%;height: 10%;text-align: center;"type="submit">提交</button>
				</c:if>
				<c:if test="${ object.state==5}">
					<button class="btn btn-primary col-sm-5 pull-right" style="width: 60%;height: 10%;text-align: center;"type="submit">修改提交审核</button>
				</c:if>
				<c:if test="${ object.state==6}">
					<button class="btn btn-primary col-sm-5 pull-right" style="width: 60%;height: 10%;text-align: center;"type="submit" disabled="disabled">编辑后提交待审核</button>
				</c:if>
				</div>
			</div>
			<input type="hidden" name="busthumbOld" value="${object.thumb}"/>
			<input type="hidden" name="perthumbOld" value="${object.perthumb}"/>
		</form>		
	 
	</div>

<jsp:include page="../../include/javascripts.jsp"></jsp:include>
<script type="text/javascript">
var bohuilog;
function BoHui(storeid){
	bohuilog = Kit.dialog("驳回原因","${BASE_PATH}/dict/seller/toBoHui/${object.sellerId}" ,{closable:true}).open();
}
/* function edit(){
	$.post("${BASE_PATH}/dict/seller/edit/${object.sellerId}",function(){
		window.location.reload();
	});
}
 */

function edit() {
	Kit.confirm("提示", "编辑将重新审核，审核通过前所有功能将不可用！！！", function() {
		$.post("${BASE_PATH}/dict/seller/edit/${object.sellerId}",function(){
			window.location.reload();
		});
	});
}
</script>
</body>	  		
</html>